import fa from "element-ui/src/locale/lang/fa";
import Shop from "@/views/shop";

const state={
    ORIGINAL_THEME:'#409EFF',
    orderTimeMap: ['中餐', '晚餐'],
    countDown:0,
    notifyList:[],
    previewThemeImg:"",
    statusData:{
        color:['#409eff','#05b200','#05b200'],
        text:['正在点餐','点餐完成','拼单用户'],
    },
    auditData:{
        color:['#409eff','#05b200','#E82043'],
        text:['正在审核','审核成功','审核失败'],
    },
    langMap:{
        zh:'中文简体',
        en:'英语',
    },
    socket:{},
    chatToUser:"",
    userSocketList:[],
    messageList:{},
    userMessageInfo:{
        create_time:"",
        chatToSelInfo:[],
        chatToOtherInfo:[],
        chatToGroupInfo:[],
    },
    userOrder:{},
    userList:[],
    waitTime:1000,
    orderStatusInfo:{},
    ioAwaitTime:0,
    apiLoading:false,
    customStyle:{
        size:'medium'
    }
}
const mutations={
    SET_PREVIEW_THEME_BG: (state, data) => {
        state.previewThemeImg=data+`?${new Date().getTime()}`
    },
    SET_USER_MESSAGE_INFO: (state, data) => {
        state.userMessageInfo.create_time=data.create_time
        state.userMessageInfo.chatToSelInfo=data.chat[0]
        state.userMessageInfo.chatToOtherInfo=data.chat[1]
        state.userMessageInfo.chatToGroupInfo=data.groupChat
    },
    SET_SOCKET_CHAT_TO: (state, data) => {
        state.chatToUser=data
    },
    SET_SOCKET: (state, data) => {
        state.socket=data
    },
    SET_SOCKET_LIST: (state, data) => {
        state.userSocketList=data
    },
    SET_MESSAGE_LIST: (state, data) => {
        state.messageList=data
    },
    SET_USER_LIST: (state, data) => {
        state.userList=data
    },
    SET_NOTIFY_LIST: (state, data) => {
        state.notifyList=data
    },
    SET_LOADING: (state, data) => {
        state.apiLoading=data
    },
    SET_COUNT_DOWN: (state, data) => {
        state.countDown=data
    },
    SET_HAD_USER: (state, data) => {
        state.userOrder[data[0]]=data[1]
    },
    SET_ORDER_TIME_MAP: (state, data) => {
        state.orderTimeMap=data
    },
    SET_ORDER_STATUS_INFO: (state, data) => {
        state.orderStatusInfo=data
    },
}
const actions={

}
export default {
    namespaced: true,
    state,
    mutations,
    actions
}
